package net;

import java.net.SocketAddress;

public interface IClient {
	Long getId();

	boolean send(byte[] msg);// 发送数据

	boolean send(Package p);// 发送数据

	Object getAttribute(Object key);

	Object setAttribute(Object key, Object value);

	Object getRealSession();

	Object setAttributeIfAbsent(Object key, Object value);

	Object removeAttribute(Object key);

	Object setAttribute(Object key);

	void close();

	boolean isClosing();

	boolean isConnected();

	SocketAddress getRemoteAddress();

	void setIgnoreMessage(boolean ignore);

	boolean isIgnoreMessage();

	void setMergeStart();

	void setMergeEnd();
	
	public <T> T getAttr(String key);
	public void setAttr(String key, Object value);
	public void removeAttr(String key);
	public void clearAttr();
}
